//
//  LeavingDetailController.m
//  Marketing
//
//  Created by Hanen 3G 01 on 16/3/4.
//  Copyright © 2016年 Hanen 3G 01. All rights reserved.
//

#import "LeavingDetailController.h"
#import "ApproSubVIew.h"


@interface LeavingDetailController ()
{
    UITableView *_scrollView;
//        UIScrollView    *_scrollView;
    
        CGFloat     topSpace;
    CGFloat labelW;
    CGFloat labelH;
        UIView    *_leavingView;//请假视图
        UIImageView     *_personLogo;
        UIImageView     *_waiteLoga;
        UILabel         *_nameLabel;
        UILabel         *_waiteLabel;
        UILabel         *_dateLabel;
        UILabel         *_timeLabel;
        
//        UIView          *_btnView;
//        UIButton        *_agreeBtn;
        UIButton        *_getLeavingBackBtn;
    
    NSDictionary   *_dataDict;
    NSMutableArray   *titleArray2;
    NSArray       *titleArray;
    
    ApproSubVIew * approView1;
    ApproSubVIew * approView2;
    UIView *botto;
    UIView *postView ;
  
}
@end

@implementation LeavingDetailController
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.view.backgroundColor = graySectionColor;
    self.navigationItem.leftBarButtonItem = [ViewTool getBarButtonItemWithTarget:self WithAction:@selector(popViewControll)];
    self.navigationItem.titleView = [ViewTool getNavigitionTitleLabel:[NSString stringWithFormat:@"%@的 请假",[[NSUserDefaults standardUserDefaults] objectForKey:@"name"]]];
    
    [self initScrollView];
    [self addLeavingView];
    [self getLeavingData];
//    [self addBtn];
    
}

- (void)getLeavingData
{
    NSDictionary *paramDict = [DataTool changeType:@{@"token" : TOKEN,@"uid" : @(UID),@"id" :@(self.leaveID)}];
    NSLog(@"参数%@",paramDict);
//    [DataTool sendGetWithUrl:LEAVING_DETAIL_URL parameters:paramDict success:^(id data) {
//        id backData = CRMJsonParserWithData(data);
//        NSLog(@"backData %@",backData);
//        
//        _dataDict = [DataTool changeType:backData];
//        //        NSLog(@"%@",_dataDict);
//        titleArray2 = [NSMutableArray arrayWithArray:@[_dataDict[@"leave"][@"dealno"],_dataDict[@"department"],_dataDict[@"leave"][@"typename"],_dataDict[@"leave"][@"begintime"],_dataDict[@"leave"][@"endtime"],_dataDict[@"leave"][@"days"],_dataDict[@"leave"][@"reason"]]];
//        
//        [self useData];
//    } fail:^(NSError *error) {
//        NSLog(@"%@",error);
//    }];
    [SVProgressHUD show];
    [DataTool postWithUrl:LEAVING_DETAIL_URL parameters:paramDict success:^(id data) {
        id backData = CRMJsonParserWithData(data);
           [SVProgressHUD dismiss];
        NSLog(@"backData %@",backData);
        if ([backData[@"code"] intValue] == 100) {
            _dataDict = [DataTool changeType:backData];
            //        NSLog(@"%@",_dataDict);
            titleArray2 = [NSMutableArray arrayWithArray:@[_dataDict[@"leave"][@"dealno"],_dataDict[@"department"],_dataDict[@"leave"][@"typename"],_dataDict[@"leave"][@"begintime"],_dataDict[@"leave"][@"endtime"],_dataDict[@"leave"][@"days"],_dataDict[@"leave"][@"reason"]]];
            
            [self useData];
        }else{
            [self.view makeToast:backData[@"message"]];
        }
        
     } fail:^(NSError *error) {
          NSLog(@"%@",error);
         [SVProgressHUD dismiss];
    }];
// [SVProgressHUD dismiss];
}
- (void)useData
{
    NSLog(@"开始时间%@",_dataDict[@"leave"][@"addtime"]);
    _dateLabel.text = [DateTool getYearmonthFromStr:_dataDict[@"leave"][@"addtime"]];
    NSString *timeStr = [[DateTool getDateFromStr:_dataDict[@"leave"][@"addtime"]] substringWithRange:NSMakeRange(0, 5)];
    _timeLabel.text = timeStr;
    int handleInt = [_dataDict[@"leave"][@"status"] intValue];
    
    if (handleInt == 0) {//待审核
           postView.hidden = NO;
//         _getLeavingBackBtn.hidden = NO;
        approView2.approvalState = 0;
        _waiteLabel.text = [NSString stringWithFormat:@"等待%@的审批",_dataDict[@"managername"]];
        _waiteLoga.hidden = NO;
        [self addCheXiaoBtn];
        approView2.handleLeavingLogo = _dataDict[@"managerlogo"];
        approView2.nameString = _dataDict[@"managername"];
        approView2.stateLabel.textColor = greenBackColor;
        approView1.apptype = 0;//发起请假的人
        approView2.apptype = 1;//审批请假的人
    }else if (handleInt == 1){
        approView2.approvalState = 1;//通过审批
        _waiteLabel.text = [NSString stringWithFormat:@"已完成审批"];
        _waiteLoga.hidden = YES;
        approView2.handleLeavingLogo = _dataDict[@"managerlogo"];
        approView2.nameString = _dataDict[@"managername"];
        
        approView1.apptype = 0;//发起请假的人
        approView2.apptype = 1;//审批请假的人
    }else if(handleInt == 2){
//         _getLeavingBackBtn.hidden = YES;
        approView2.approvalState = 2;//未通过审批
        _waiteLabel.text = [NSString stringWithFormat:@"未通过审批"];
        _waiteLoga.hidden = YES;
        approView2.handleLeavingLogo = _dataDict[@"managerlogo"];
        approView2.nameString = _dataDict[@"managername"];
        
        approView1.apptype = 0;//发起请假的人
        approView2.apptype = 1;//审批请假的人
    }else if(handleInt == 3){
           postView.hidden = YES;
//        _getLeavingBackBtn.hidden = YES;
        _waiteLabel.text = [NSString stringWithFormat:@"已撤销"];
        approView2.approvalState = 3;//已撤销
        approView2.nameString = [NSString stringWithFormat:@"我(%@)",[[NSUserDefaults standardUserDefaults] objectForKey:@"name"]];
        approView2.leavingPersonLogo = [[NSUserDefaults standardUserDefaults] objectForKey:@"logo"];
////        approView2.handleLeavingLogo = [[NSUserDefaults standardUserDefaults] objectForKey:@"logo"];
//        approView2.handleLeavingLogo = _dataDict[@"managerlogo"];
//        approView2.nameString = _dataDict[@"managername"];
    
        approView1.apptype = 0;//发起请假的人
        approView2.apptype = 1;//自己处理的请假
        _waiteLoga.hidden = YES;
    }
    
   
    
    for (int i = 0; i< titleArray2.count; i++) {
        
        //         NSLog(@"titleArray2 %@",titleArray2[i]);
        UILabel * label = [_leavingView viewWithTag:5566 + i];
        //给每个label 信息赋值  有一个请假天数不是字符串类型的 是int
        if ([titleArray2[i] isKindOfClass:[NSString class]]) {
            label.text = titleArray2[i];
        }else{
            label.text = [NSString stringWithFormat:@"%@",titleArray2[i]];
            //            label.backgroundColor = [UIColor redColor];
            //            NSLog(@"天数 ==%@",titleArray2[i]);
        }
        if (i == titleArray2.count -1) {
            label.numberOfLines = 0;
            //#warning 获得请假事由计算高度
            if (label.text != nil) {
                CGRect frame = label.frame;
                CGFloat h = [label.text boundingRectWithSize:CGSizeMake(label.width, MAXFLOAT) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:16.0f], NSForegroundColorAttributeName : grayFontColor} context:nil].size.height;
                if (h<40.0f) {//40.0发是 每个最低的 高度
                    h = 40.0f;
                }
                label.frame = CGRectMake(frame.origin.x, frame.origin.y - 2, frame.size.width, h);
           
            }
            _leavingView.frame = CGRectMake(0, 0, KSCreenW, label.maxY + topSpace);
        }
        
    }
    UIView *line1 = [ViewTool getLineViewWith:CGRectMake(0, _leavingView.maxY - 1, KSCreenW , 1) withBackgroudColor:graySectionColor];
    [_leavingView addSubview:line1];
    
    CGRect bottomFrame = botto.frame;
    bottomFrame.origin.y = _leavingView.maxY + 17.0f;
    botto.frame = bottomFrame;
  
 
    CGFloat diffsdf;
    if(handleInt == 0){
    if (botto.maxY < KSCreenH - 70.0f - 64) {
        diffsdf = KSCreenH - 70 - botto.maxY - 64 + 30;
        UIView *vi = [ViewTool getLineViewWith:CGRectMake(0, botto.maxY, KSCreenW, diffsdf) withBackgroudColor:graySectionColor];
        [_scrollView addSubview:vi];
        _scrollView.contentSize = CGSizeMake(KSCreenW, vi.maxY+ 10);
    }else{
        _scrollView.contentSize = CGSizeMake(0, botto.maxY + 30.0f);
    }
    }else{
        CGRect scrolFrem = _scrollView.frame;
        scrolFrem.size.height = KSCreenH - 64;
        _scrollView.frame = scrolFrem;
        
        if (botto.maxY < KSCreenH  - 64) {
            diffsdf = KSCreenH - botto.maxY - 64 + 30;
            UIView *vi = [ViewTool getLineViewWith:CGRectMake(0, botto.maxY, KSCreenW, diffsdf) withBackgroudColor:graySectionColor];
            [_scrollView addSubview:vi];
            _scrollView.contentSize = CGSizeMake(KSCreenW, vi.maxY+ 10);
        }else{
            _scrollView.contentSize = CGSizeMake(0, botto.maxY + 30.0f);
        }
    }
}
- (void)setLstatusType:(int)lstatusType
{
    _lstatusType = lstatusType;
    if (lstatusType != 0) {
        _waiteLoga.hidden = YES;
    }
}
//- (void)addinfo
//{
//    //请假类型要再处理一下
//    titleArray2 = [NSMutableArray arrayWithArray:@[_dataDict[@"dealno"],_dataDict[@"department"],_dataDict[@"type"],_dataDict[@"begintime"],_dataDict[@"endtime"],_dataDict[@"days"],_dataDict[@"reason"]]];
//    for (int i = 0; i< titleArray.count; i++) {
//        UILabel * label = [_leavingView viewWithTag:7788 + i];
//        label.text = titleArray2[i];
//        if (i == titleArray.count -1) {
//            label.numberOfLines = 0;
//#warning 获得请假事由计算高度
//    CGFloat h = [label.text boundingRectWithSize:CGSizeMake(label.width, MAXFLOAT) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:13.0f], NSForegroundColorAttributeName : grayFontColor} context:nil].size.height;
//     label.frame = CGRectMake(label.maxX + topSpace, topSpace + i * (labelH + 0.5 * topSpace), KSCreenW - label.maxX - 2 * topSpace, h);
//            _leavingView.frame = CGRectMake(0, 0, KSCreenW, label.maxY + topSpace);
//        }
//    }
//  
//
//    
//}
- (void)initScrollView
{
     _scrollView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KSCreenH, KSCreenH - 64 -  70.0f)];//70.0f是最底下的按钮背景 高度
    _scrollView.separatorStyle = UITableViewCellSeparatorStyleNone;
//    _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, KSCreenH, KSCreenH - 64)];
    _scrollView.backgroundColor = graySectionColor;
    [self.view addSubview:_scrollView];
    
}
- (void)addLeavingView
{
    
    if (IPhone4SInCell) {
        topSpace = 6.0f;
    }else{
        topSpace = [UIView getWidth:8.0f];
    }
    _leavingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KSCreenW, [UIView getWidth:300])];
    _leavingView.backgroundColor = [UIColor whiteColor];
    [_scrollView addSubview:_leavingView];
    
    
    CGFloat logoW = [UIView getWidth:40];
    _personLogo = [[UIImageView alloc] initWithFrame:CGRectMake(2 * topSpace, topSpace, logoW, logoW)];
    [_personLogo sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",LoadImageUrl,[[NSUserDefaults standardUserDefaults] objectForKey:@"logo"]]] placeholderImage:nil];
    _personLogo.backgroundColor = greenBackColor;
    _personLogo.layer.cornerRadius = logoW / 2.0f;
    _personLogo.layer.masksToBounds = YES;
    [_leavingView addSubview:_personLogo];
    
    CGFloat waiteLogoW = [UIView getWidth:13.0f];
    _waiteLoga = [[UIImageView alloc] initWithFrame:CGRectMake(logoW , _personLogo.maxY - waiteLogoW, waiteLogoW , waiteLogoW)];
    //    _waiteLoga.backgroundColor = [UIColor redColor];
    _waiteLoga.image = [UIImage imageNamed:@"HY_map_icon_time"];
    [ _leavingView addSubview:_waiteLoga];
    
    _nameLabel = [ViewTool getLabelWith:CGRectMake(_personLogo.maxX + 2 * topSpace, _personLogo.y + _personLogo.height / 2.0f - ([UIView getHeight:15]) , KSCreenW - _personLogo.maxX - 4 * topSpace, [UIView getHeight:15]) WithTitle:[[NSUserDefaults standardUserDefaults] objectForKey:@"name"] WithFontSize:16.0f WithTitleColor:blackFontColor WithTextAlignment:NSTextAlignmentLeft];
    [_leavingView addSubview:_nameLabel];
    
    //这里 拿到请假发给的对象
    _waiteLabel = [ViewTool getLabelWith:CGRectMake(_nameLabel.x, _nameLabel.maxY, [UIView getWidth:100], [UIView getHeight:15]) WithTitle:@"..." WithFontSize:14.0f WithTitleColor:grayFontColor WithTextAlignment:NSTextAlignmentLeft];
    [_leavingView addSubview:_waiteLabel];
    
    CGFloat dateW = [UIView getWidth:80];
    CGFloat dateX = KSCreenW - 2 * topSpace - dateW;
    _dateLabel = [ViewTool getLabelWith:CGRectMake(dateX , _nameLabel.maxY - [UIView getHeight:15.0f], dateW, [UIView getHeight:15]) WithTitle:@"..." WithFontSize:14.0f WithTitleColor:greenBackColor WithTextAlignment:NSTextAlignmentRight];
    //    _dateLabel.backgroundColor = [UIColor orangeColor];
    [_leavingView addSubview:_dateLabel];
    
    CGFloat timeW = [UIView getWidth:60];
    CGFloat timeX = KSCreenW - 2 * topSpace - timeW;
    _timeLabel = [ViewTool getLabelWith:CGRectMake(timeX, _waiteLabel.y,timeW, [UIView getHeight:15]) WithTitle:@"...." WithFontSize:14.0f WithTitleColor:greenBackColor WithTextAlignment:NSTextAlignmentRight];
    [_leavingView addSubview:_timeLabel];
    
    UIView *line = [ViewTool getLineViewWith:CGRectMake(0, _personLogo.maxY + topSpace , KSCreenW, 20.0f) withBackgroudColor:graySectionColor];
//    line.layer.borderWidth = 0.8;
//    line.layer.borderColor = grayLineColor.CGColor;
    [_leavingView addSubview:line];
    
     UIView *l1 = [ViewTool getLineViewWith:CGRectMake(0, 0 , KSCreenW, 1) withBackgroudColor:grayLineColor];
    
     UIView *l2 = [ViewTool getLineViewWith:CGRectMake(0, line.height - 1 , KSCreenW, 1) withBackgroudColor:grayLineColor];
    [line addSubview:l1];
    [line addSubview:l2];
    
   titleArray = @[@"审批编号",@"所在部门",@"请假类型",@"开始时间",@"结束时间",@"请假天数",@"请假事由"];
  
    for (int i = 0; i < titleArray.count ; i ++) {
        labelW = 80.0f;
//        labelH = [UIView getWidth:0.0];
        labelH = 40.0f;
        CGFloat contentLabelH = 40.0f;
        UILabel *label = [ViewTool getLabelWith:CGRectMake(2 * topSpace, line.maxY  + i * (labelH ), labelW, labelH) WithTitle:titleArray[i] WithFontSize:15.0f WithTitleColor:grayFontColor WithTextAlignment:NSTextAlignmentLeft];
        [_leavingView addSubview:label];
        
        UILabel *contentLabel = [ViewTool getLabelWith:CGRectMake(label.maxX , label.y, KSCreenW - label.maxX - 2 * topSpace, contentLabelH) WithTitle:titleArray2[i] WithFontSize:16.0f WithTitleColor:blackFontColor WithTextAlignment:NSTextAlignmentLeft];
        contentLabel.tag = 5566 + i;
        //        contentLabel.backgroundColor = blueFontColor;
        [_leavingView addSubview:contentLabel];
        //最后一个请假事由可以根据字数来设定label的高度.
        
//        UIView *line = [ViewTool getLineViewWith:CGRectMake(label.x, contentLabel.maxY , KSCreenW - label.x, 1.0f) withBackgroudColor:grayLineColor];
//        [_leavingView addSubview:line];
        
        if (i == titleArray.count -1) {
           
            contentLabel.numberOfLines = 0;
//#warning 获得请假事由计算高度
            //            CGFloat h = [contentLabel.text boundingRectWithSize:CGSizeMake(contentLabel.width, MAXFLOAT) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:13.0f], NSForegroundColorAttributeName : grayFontColor} context:nil].size.height;
            //            contentLabel.frame = CGRectMake(label.maxX + topSpace, topSpace + i * (labelH + 0.5 * topSpace), KSCreenW - label.maxX - 2 * topSpace, h);
            _leavingView.frame = CGRectMake(0, 0, KSCreenW, contentLabel.maxY + topSpace);
        }else{
            UIView *l = [ViewTool getLineViewWith:CGRectMake(label.x, label.maxY , KSCreenW - label.x, 1.0f) withBackgroudColor:grayLineColor];
            [_leavingView addSubview:l];
        }
    }
    //    _leavingView.backgroundColor = [UIColor redColor];
//    UIView *line1 = [ViewTool getLineViewWith:CGRectMake(0, _leavingView.maxY - 1, KSCreenW , 1) withBackgroudColor:lightGrayBackColor];
//    [_leavingView addSubview:line1];
    
    [self addBottonView];
  
}
- (void)addBottonView
{
  botto = [ViewTool getLineViewWith:CGRectMake(0, _leavingView.maxY + 17.0f, KSCreenW, [UIView getWidth:60] * 2 ) withBackgroudColor:[UIColor whiteColor]];
    [_scrollView addSubview:botto];
    
   //需要审批的额
       approView2 = [[ApproSubVIew alloc] initWithFrame:CGRectMake(0,  0, KSCreenW, [UIView getWidth:60])];
    //发起申请的
    approView1 = [[ApproSubVIew alloc] initWithFrame:CGRectMake(0, approView2.maxY, KSCreenW , [UIView getWidth:60])];
//    approView1.backgroundColor = NavBackColor;
//        approView1.isHadApproval = NO;
   
    //
 
    
 
//        approView2.isHadApproval = NO;
//        approView2.backgroundColor = lightGrayBackColor;

       approView2.upLabel.hidden = YES;
    
    NSString *username = [[NSUserDefaults standardUserDefaults] objectForKey:@"name"];
    NSLog(@"用户名字%@",username);
    approView1.nameString = [NSString stringWithFormat:@"我(%@)",username];
     approView1.leavingPersonLogo = [[NSUserDefaults standardUserDefaults] objectForKey:@"logo"];
//    NSLog(<#NSString * _Nonnull format, ...#>)
 
    //sdhfjsfksdfvgff
   


    
 
    
//    UIView *linV = [ViewTool getLineViewWith:CGRectMake(approView2.x + approView1.approvalStateImage.width / 2.0f, _leavingView.maxY, 0.5, approView2.y - _leavingView.maxY) withBackgroudColor:grayLineColor];
//    [_scrollView addSubview:linV];
    
    [botto addSubview:approView1];
    [botto addSubview:approView2];
    
    
    
    
 
}

#pragma mark --撤销
- (void)addCheXiaoBtn
{
    
//    _scrollView.frame =  CGRectMake(0, 64, KSCreenH, KSCreenH - TabbarH- 64);
//    _getLeavingBackBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, KSCreenH - TabbarH, KSCreenW, TabbarH)];
//    [_getLeavingBackBtn setTitle:@"撤销" forState:UIControlStateNormal];
////    _getLeavingBackBtn.backgroundColor = [UIColor redColor];
//    [_getLeavingBackBtn setTitleColor:darkOrangeColor forState:UIControlStateNormal];
//    [_getLeavingBackBtn addTarget:self action:@selector(getBack) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:_getLeavingBackBtn];
//    
//    
//    UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KSCreenW, 1)];
//    line.backgroundColor =grayLineColor;
//    [_getLeavingBackBtn addSubview:line];

    
    postView = [ViewTool getLineViewWith:CGRectMake(0, KSCreenH - 70.0f - 64, KSCreenW, 70.0f) withBackgroudColor:[UIColor whiteColor]];
    [self.view addSubview:postView];
    
    _getLeavingBackBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 8, postView.width - 20, postView.height - 13)];
//    _getLeavingBackBtn.layer.cornerRadius = 4.0f;
//    _getLeavingBackBtn.layer.masksToBounds = YES;
//    _getLeavingBackBtn.layer.shouldRasterize = YES;
    
    [_getLeavingBackBtn addTarget:self action:@selector(getBack) forControlEvents:UIControlEventTouchUpInside];
    [_getLeavingBackBtn setTitle:@"撤销" forState:UIControlStateNormal];
    [_getLeavingBackBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [_getLeavingBackBtn setBackgroundImage:[UIImage imageNamed:@"HY_btn_red_normal.png"] forState:UIControlStateNormal];
    [_getLeavingBackBtn setBackgroundImage:[UIImage imageNamed:@"HY_btn_red_press.png"] forState:UIControlStateHighlighted];
  
    [postView addSubview:_getLeavingBackBtn];
    
    UIView *line3 = [ViewTool getLineViewWith:CGRectMake(0, 0, KSCreenW, 1) withBackgroudColor:grayLineColor];
    [postView addSubview:line3];




}

- (void)getBack
{
    NSDictionary *dict = @{@"token" : TOKEN,@"uid" : @(UID),@"id" : @([_dataDict[@"leave"][@"id"] intValue]),@"lstatus" :@(3)};
    NSLog(@"撤销请假的参数%@",dict);
    
    [DataTool postWithUrl:HANDLE_LEAVING_URL parameters:dict success:^(id data) {
        id bacData = CRMJsonParserWithData(data);
        NSLog(@"%@",bacData);
        if ([bacData[@"code"] intValue]== 100) {
            [self.view makeToast:@"撤销成功"];
            [self getLeavingData];//撤销过后再重新请求下数据
            postView.hidden = YES;
//            _getLeavingBackBtn.hidden = YES;
            [self performSelector:@selector(popViewControll) withObject:nil afterDelay:0.5f];
        }else{
            [self.view makeToast:@"撤销失败"];
        }
    } fail:^(NSError *error) {
        NSLog(@"%@",error.localizedDescription);
    }];
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBarHidden = NO;
    self.tabBarController.hidesBottomBarWhenPushed = YES;
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    self.tabBarController.hidesBottomBarWhenPushed = NO;
}

- (void)popViewControll
{
    [self.navigationController popViewControllerAnimated:YES];
}


@end
